package com.cy.dao.impl;

import com.cy.dao.SysNoticeDao;
import com.cy.dao.pojo.SysNotice;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class SysNoticeDaoImpl implements SysNoticeDao {
    @Autowired
    private SqlSession sqlSession;

    @Override
    public List<SysNotice> selectNotice(SysNotice sysNotice) {
        String interfaceName = this.getClass().getInterfaces()[0].getName();
        String elementId = Thread.currentThread().getStackTrace()[1].getMethodName();

        String  statement = interfaceName+"."+elementId;
        System.out.println(statement);
        List<SysNotice> list = sqlSession.selectList(statement, sysNotice);

        return list;
    }

    @Override
    public int deleteById(Long... id) {
        return 0;
    }

    @Override
    public SysNotice selectById(Long id) {
        return null;
    }

    @Override
    public int insertNotice(SysNotice sysNotice) {
        return 0;
    }

    @Override
    public int updateNotice(SysNotice sysNotice) {
        return 0;
    }
}
